#include <REGX52.H>
#include "delay.h"

/** @bref 获得独立键盘的按下的键值
  * @param 无
  * @retval 独立键盘的按下的键值
  */
unsigned char getKeyNumber()
{
	unsigned char keyNumber = 0;
	
	if(P3_1 == 0){delay(20);while(P3_1 == 0);delay(20);keyNumber = 1;}
	if(P3_0 == 0){delay(20);while(P3_0 == 0);delay(20);keyNumber = 2;}
	if(P3_2 == 0){delay(20);while(P3_2 == 0);delay(20);keyNumber = 3;}
	if(P3_3 == 0){delay(20);while(P3_3 == 0);delay(20);keyNumber = 4;}

	return keyNumber;
}